<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<link href="__STATIC__/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
		<!-- Loading Flat UI -->
		<link href="__STATIC__/Flat/dist/css/flat-ui.css" rel="stylesheet">
			
		<link href="__STATIC__/Admin/css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="__STATIC__/Admin/js/jquery.js"></script>
		<script language="javascript">
			$(function() {
				//导航切换
				$(".imglist li").click(function() {
					$(".imglist li.selected").removeClass("selected")
					$(this).addClass("selected");
				})
				
			})
		</script>
		
	</head>

	<body>

		<div class="place">
			<span>位置：</span>
			<ul class="placeul">
				<li><a href="#">商品管理</a></li>
				<li><a href="#">商品管理</a></li>
				<li><a href="#">商品列表</a></li>
			</ul>
		</div>

		<div class="rightinfo">
			<div class="tools">
				<ul class="toolbar">
					<li class="click">
						<a href="{|U:'Add',array('gcid'=>$_GET['gcid'])}">
							<span>
	        						<img src="__STATIC__/Admin/images/t01.png" />
	      					</span>添加商品
						</a>
					</li>
				</ul>
			</div>
			<table class="imgtable">

				<thead>
					<tr>
						<th>ID</th>
						<th width="100px;">列表图</th>
						<th width="230px">商品名称</th>
						<th>价格</th>
						<th>库存</th>
						<th>点击次数</th>
						<th>上架时间</th>
						<th>是否推荐</th>
						<th>管理员</th>
						<th>操作</th>
					</tr>
				</thead>

				<tbody>
					<if value="count($data)==0">
						<tr>
							<td colspan="9" align="center">
								还没有任何商品，赶紧 <a href="{|U:'Add',array('gcid'=>$_GET['gcid'])}">添加</a> 吧
							</td>
						</tr>
					<else/>
						<foreach from="$data" key="$k" value="$v">
							<tr>
								<td>{$v.gid}</td>
								<td class="imgtd" style="width:100px">
									<img src="__ROOT__/{$v.listpic}" width="100"/>
								</td>
								<td style="width: 230px;padding: 10px;text-indent: 0;"><span>{$v.gname}</span></td>
								<td>
									<span>市场价：<em><s>{$v.marketprice}</s></em></span>
									<span>商城价：<b style="color:red;font-weight: normal;">{$v.shopprice}</b></span>		
								</td>
								<td>{$v.stock} {$v.unit}</td>
								<td>{$v.click}</td>
								<td>{$v.shelftime|date:"Y-m-d",@@}</td>
								<td>
									<if value="$v['is_recommend']==1">
										<span class="fui-check" style="color:green"></span>
									<else/>
										<span class="fui-cross" style="color:red"></span>
									</if>
								</td>
								<td>{$v.username}</td>
								<td>
									<a href="{|U:'GoodsList/Index',array('gid'=>$v['gid'])}" class="tablelink">货品列表</a>
									<a href="{|U:'Edit',array('gid'=>$v['gid'],'gcid'=>$_GET['gcid'])}" class="tablelink">修改</a>
									<a href="{|U:'Del',array('gid'=>$v['gid'],'gcid'=>$_GET['gcid'])}" class="tablelink" onclick="if (!confirm('确认要删除吗？')) return false;">删除</a>
								</td>
							</tr>
						</foreach>
					</if>

				</tbody>

			</table>		

		</div>

		<script type="text/javascript">
			$('.imgtable tbody tr:odd').addClass('odd');
		</script>

	</body>

</html>